<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/view/main/stylesheet.jsp"%>
<link rel="stylesheet" type="text/css" href="${baseurl}/styles/frameword/css/list.css" />
<script src="${baseurl}/styles/frameword/js/list.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	var typejson = <wb:html wbCode="pro-extract-type" type="json" name="" />
	$(function() {
		var url = "/pro-driver-user-extract/apply/";
		var columns = [
				{
					field : 'mobile',
					title : '手机号'
				},
				{
					field : 'userName',
					title : '用户名'
				},
				{
					field : 'withdrawal',
					title : '累计体现',
					formatter : function(value, row, index) {
						return (value/100).toFixed(2);
					}
				},
				{
					field : 'addTime',
					title : '申请时间',
					formatter : function(value, row, index) {
						return format(new Date(value),'yyyy-MM-dd hh:mm:ss');
					}
				},
				{
					field : 'amount',
					title : '金额',
					formatter : function(value, row, index) {
						return (value/100).toFixed(2);
					}
				},
				{
					field : 'type',
					title : '渠道',
					formatter : function(value, row, index) {
						return typejson[value];
					}
				},
				{
					field : 'account',
					title : '账户'
				},
				{
					field : 'operate',
					title : '操作',
					align : 'center',
					events : {
						'click .BtnOfComplete' : function(e, value, row, index) {
							layer.confirm('确定完成?', {
								btn : [ '确定', '取消' ]
							}, function() {
								$.get(baseUrl + url + '/complete/'
										+ row.primaryKey, function(result) {
									if (result) {
										$("#table1").bootstrapTable('refresh');
										layer.msg('操作成功', {
											icon : 1,
											time : 1000
										});
									}
								}, "json");
							}, function() {
								layer.closeAll('dialog');
							});
						},
						'click .BtnOfRefuse' : function(e, value, row, index) {
							layer.confirm('确定拒绝?', {
								btn : [ '确定', '取消' ]
							}, function() {
								$.get(baseUrl + url + '/refuse/'
										+ row.primaryKey, function(result) {
									if (result) {
										$("#table1").bootstrapTable('refresh');
										layer.msg('操作成功', {
											icon : 1,
											time : 1000
										});
									}
								}, "json");
							}, function() {
								layer.closeAll('dialog');
							});
						}
					},
					formatter : function(value, row, index) {
						return [
								'<span class="BtnOfComplete pointer glyphicon glyphicon-list" style="margin-right:15px;">完成</span>',//
								'<span class="BtnOfRefuse pointer glyphicon glyphicon-edit" style="margin-right:15px;">拒绝</span>', ]
								.join('');
					},
				} ];
		initListDefault(url, columns)
	})
</script>
</head>
<body class="container-fluid">
	<form class="bs-example bs-example-form" role="form" id="form1">
		<table class="table noline">

		</table>
	</form>
	<table id="table1">
	</table>
</body>

</html>